package com.ddzh.feign;

import com.ddzh.feign.fallback.UserFeignApiFallback;
import com.ddzh.pojo.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
//fallback = UserFeignApiFallback.class,整合 Hystrix 的降级处理
@FeignClient(value="user-service",fallback = UserFeignApiFallback.class)
public interface UserFeignApi {

    @GetMapping("user/{username}")
    public User findUserById(@PathVariable("username") String username) ;
}
